package com.iflytek.cuckoo.utils;

/**
 * <p><一句话功能简述>
 * <p><功能详细描述>
 * <p>
 * <p>Copyright (c) 2018, liangzhang14@iflytek.com All Rights Reserve</p>
 * <p>Company : 科大讯飞</p>
 *
 * @author liangzhang14
 * @version [V1.0, 2019年08月01日 16:45]
 * @see [相关类/方法]
 */
public class Test {


    public static void test1() {

        String TEMP_SHA1_PREFIX = "";
        String sql = "SELECT * \n" +
                "FROM (SELECT rownum rnum, \n" +
                "               inner_query.* \n" +
                "        FROM (SELECT b.sha1, \n" +
                "                       b.md5, \n" +
                "                       b.bin_length, \n" +
                "                       b.sha256 \n" +
                "                FROM   binaries b \n" +
                "                WHERE  b.sha1 NOT LIKE '" + TEMP_SHA1_PREFIX + "%' \n" +
                "                       AND NOT EXISTS (SELECT n.node_id \n" +
                "                                       FROM   nodes n \n" +
                "                                       WHERE  n.sha1_actual = b.sha1)) \n" +
                "               inner_query \n" +
                "        WHERE rownum <= ?) \n" +
                "WHERE rnum > 0 \n" +
                "ORDER BY bin_length DESC";

        System.out.println(sql);
    }

    public static void main(String[] args) {
        test1();
    }
}
